LIS590DV Final Project - Group Athena

Part1 - Bus stops on Google Map

Author: Hui Lyu


In [1]:
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import csv
from collections import Counter

In [2]:
%matplotlib inline

In [3]:
import gmaps
import gmaps.datasets 
gmaps.configure(api_key="AIzaSyBpKgJ8kfC7ixF-oJGZMb49k1knCw6wHyA")

In [4]:
stops_df = pd.read_csv("GTFS Dataset/stops.csv")

In [5]:
stops_df.columns


Out[5]:
Index(['stop_id', 'stop_code', 'stop_name', 'stop_desc', 'stop_lat',
       'stop_lon', 'zone_id', 'stop_url', 'location_type', 'parent_station'],
      dtype='object')

In [6]:
locations = stops_df[["stop_lat", "stop_lon"]]

In [7]:
stops_df.head()


Out[7]:
stop_id stop_code stop_name stop_desc stop_lat stop_lon zone_id stop_url location_type parent_station
0 KBYWSFLD:3 MTD4346 Kirby & Westfield (South Side) NaN 40.098248 -88.290173 1 http://www.cumtd.com/maps-and-schedules/bus-st... 0 NaN
1 PHILOMI:4 MTD1026 Philo & Michigan (NW Corner) NaN 40.101792 -88.190865 1 http://www.cumtd.com/maps-and-schedules/bus-st... 0 NaN
2 DNCNCLKRD:2 MTD3333 Duncan & Clark (SE Corner) NaN 40.117390 -88.295470 1 http://www.cumtd.com/maps-and-schedules/bus-st... 0 NaN
3 TRLSPHILO:1 MTD6424 Trails & Philo (NE Corner) NaN 40.077915 -88.190315 1 http://www.cumtd.com/maps-and-schedules/bus-st... 0 NaN
4 RMNERKA:4 MTD4040 Romine & Eureka (NW Corner) NaN 40.125585 -88.227525 1 http://www.cumtd.com/maps-and-schedules/bus-st... 0 NaN

In [8]:
plt.rcParams["figure.figsize"] = (12, 12)
stops_layer = gmaps.symbol_layer(locations, fill_color="blue", stroke_color="blue", scale=1)
m = gmaps.Map()
m.add_layer(stops_layer)
m

In [ ]: